#include "pull.h"
#include <iostream>

PullEndpoint::PullEndpoint(const std::string& address) {
    context = zmq::context_t(); // 使用默认构造函数初始化 context
    receiver = zmq::socket_t(context, zmq::socket_type::pull); // 使用 context 初始化 receiver
    receiver.connect(address); // 连接到指定地址
}


void PullEndpoint::receiveTask() {
    zmq::message_t task;
    receiver.recv(task, zmq::recv_flags::none);
    std::cout << "Received: " << task.to_string() << std::endl;
}
